package com.ykfk.cngrain.tbw.model;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.PK;
import org.nutz.dao.entity.annotation.Table;

/**
 * 
 * @类名 TbUserRole
 * @描述 TbUserRole 实体类 复合主键顺序：loginid、roleCode
 * @作者 wdfang
 * @日期 2013-1-30 下午7:23:47
 * ========修改日志=======
 *
 */
@Table("TB_USER_ROLE")
@PK({"loginid","roleCode"})
public class TbUserRole {
	@Column
	private String loginid;
	@Column("roleCode")
	private String roleCode;

	public TbUserRole() {
	}

	public TbUserRole(String loginid, String roleCode) {
		this.loginid = loginid;
		this.roleCode = roleCode;
	}

	public String getLoginid() {
		return this.loginid;
	}

	public void setLoginid(String loginid) {
		this.loginid = loginid;
	}

	public String getRoleCode() {
		return this.roleCode;
	}

	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TbUserRole))
			return false;
		TbUserRole castOther = (TbUserRole) other;

		return ((this.getLoginid() == castOther.getLoginid()) || (this
				.getLoginid() != null
				&& castOther.getLoginid() != null && this.getLoginid().equals(
				castOther.getLoginid())))
				&& ((this.getRoleCode() == castOther.getRoleCode()) || (this
						.getRoleCode() != null
						&& castOther.getRoleCode() != null && this
						.getRoleCode().equals(castOther.getRoleCode())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getLoginid() == null ? 0 : this.getLoginid().hashCode());
		result = 37 * result
				+ (getRoleCode() == null ? 0 : this.getRoleCode().hashCode());
		return result;
	}

}